import {
  af as e,
  ae as n,
  b7 as t,
  ab as o,
  a3 as i,
  a4 as r,
  b8 as a,
  a5 as s,
  d as l,
  h as c,
  am as d,
  R as u,
  aV as f,
  a8 as p,
  r as h,
  j as v,
  a9 as g,
  ah as m,
  P as b,
  aI as x,
  K as y,
  ap as C,
  aa as w,
  _ as S,
  b9 as z,
  ba as k,
  bb as O,
  bc as P,
  bd as A,
  aJ as R,
  M as j,
  be as E,
  bf as L,
  ax as $,
  bg as B,
  bh as I,
  D as H,
  bi as F,
  bj as T,
  aE as _,
  b4 as N,
  aP as M,
  ag as D,
  b5 as U,
  bk as W,
  bl as K,
  bm as q,
  bn as V,
  bo as J,
  o as X,
  a6 as Y,
  a7 as G,
  bp as Q,
  F as Z,
  bq as ee,
  br as ne,
  a2 as te,
  aH as oe,
  bs as ie,
  bt as re,
  bu as ae,
  n as se,
} from "./DpD38Hq9.js";
import { u as le } from "./AE7psNvX.js";
function ce() {
  const o = n(t, null);
  return (
    null === o && e("use-dialog", "No outer <n-dialog-provider /> founded."), o
  );
}
const de = o("n-loading-bar"),
  ue = o("n-loading-bar-api");
const fe = {
    common: i,
    self: function (e) {
      const { primaryColor: n, errorColor: t } = e;
      return { colorError: t, colorLoading: n, height: "2px" };
    },
  },
  pe = r(
    "loading-bar-container",
    "\n z-index: 5999;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n",
    [
      a({ enterDuration: "0.3s", leaveDuration: "0.8s" }),
      r(
        "loading-bar",
        "\n width: 100%;\n transition:\n max-width 4s linear,\n background .2s linear;\n height: var(--n-height);\n ",
        [
          s("starting", "\n background: var(--n-color-loading);\n "),
          s(
            "finishing",
            "\n background: var(--n-color-loading);\n transition:\n max-width .2s linear,\n background .2s linear;\n "
          ),
          s(
            "error",
            "\n background: var(--n-color-error);\n transition:\n max-width .2s linear,\n background .2s linear;\n "
          ),
        ]
      ),
    ]
  );
var he = function (e, n, t, o) {
  return new (t || (t = Promise))(function (i, r) {
    function a(e) {
      try {
        l(o.next(e));
      } catch (n) {
        r(n);
      }
    }
    function s(e) {
      try {
        l(o.throw(e));
      } catch (n) {
        r(n);
      }
    }
    function l(e) {
      var n;
      e.done
        ? i(e.value)
        : ((n = e.value),
          n instanceof t
            ? n
            : new t(function (e) {
                e(n);
              })).then(a, s);
    }
    l((o = o.apply(e, n || [])).next());
  });
};
function ve(e, n) {
  return `${n}-loading-bar ${n}-loading-bar--${e}`;
}
const ge = l({
    name: "LoadingBar",
    props: { containerClass: String, containerStyle: [String, Object] },
    setup() {
      const { inlineThemeDisabled: e } = p(),
        { props: t, mergedClsPrefixRef: o } = n(de),
        i = h(null),
        r = h(!1),
        a = h(!1),
        s = h(!1),
        l = h(!1);
      let c = !1;
      const d = h(!1),
        u = v(() => {
          const { loadingBarStyle: e } = t;
          return e ? e[d.value ? "error" : "loading"] : "";
        });
      function f() {
        return he(this, void 0, void 0, function* () {
          (r.value = !1),
            (s.value = !1),
            (c = !1),
            (d.value = !1),
            (l.value = !0),
            yield b(),
            (l.value = !1);
        });
      }
      function x() {
        return he(
          this,
          arguments,
          void 0,
          function* (e = 0, n = 80, t = "starting") {
            if (((a.value = !0), yield f(), c)) return;
            (s.value = !0), yield b();
            const r = i.value;
            r &&
              ((r.style.maxWidth = `${e}%`),
              (r.style.transition = "none"),
              r.offsetWidth,
              (r.className = ve(t, o.value)),
              (r.style.transition = ""),
              (r.style.maxWidth = `${n}%`));
          }
        );
      }
      const y = g("LoadingBar", "-loading-bar", pe, fe, t, o),
        C = v(() => {
          const {
            self: { height: e, colorError: n, colorLoading: t },
          } = y.value;
          return {
            "--n-height": e,
            "--n-color-loading": t,
            "--n-color-error": n,
          };
        }),
        w = e ? m("loading-bar", void 0, C, t) : void 0;
      return {
        mergedClsPrefix: o,
        loadingBarRef: i,
        started: a,
        loading: s,
        entering: r,
        transitionDisabled: l,
        start: x,
        error: function () {
          if (!c && !d.value)
            if (s.value) {
              d.value = !0;
              const e = i.value;
              if (!e) return;
              (e.className = ve("error", o.value)),
                (e.style.maxWidth = "100%"),
                e.offsetWidth,
                (s.value = !1);
            } else
              x(100, 100, "error").then(() => {
                d.value = !0;
                const e = i.value;
                e &&
                  ((e.className = ve("error", o.value)),
                  e.offsetWidth,
                  (s.value = !1));
              });
        },
        finish: function () {
          return he(this, void 0, void 0, function* () {
            if (c || d.value) return;
            a.value && (yield b()), (c = !0);
            const e = i.value;
            e &&
              ((e.className = ve("finishing", o.value)),
              (e.style.maxWidth = "100%"),
              e.offsetWidth,
              (s.value = !1));
          });
        },
        handleEnter: function () {
          r.value = !0;
        },
        handleAfterEnter: function () {
          r.value = !1;
        },
        handleAfterLeave: function () {
          return he(this, void 0, void 0, function* () {
            yield f();
          });
        },
        mergedLoadingBarStyle: u,
        cssVars: e ? void 0 : C,
        themeClass: null == w ? void 0 : w.themeClass,
        onRender: null == w ? void 0 : w.onRender,
      };
    },
    render() {
      if (!this.started) return null;
      const { mergedClsPrefix: e } = this;
      return c(
        d,
        {
          name: "fade-in-transition",
          appear: !0,
          onEnter: this.handleEnter,
          onAfterEnter: this.handleAfterEnter,
          onAfterLeave: this.handleAfterLeave,
          css: !this.transitionDisabled,
        },
        {
          default: () => {
            var n;
            return (
              null === (n = this.onRender) || void 0 === n || n.call(this),
              u(
                c(
                  "div",
                  {
                    class: [
                      `${e}-loading-bar-container`,
                      this.themeClass,
                      this.containerClass,
                    ],
                    style: this.containerStyle,
                  },
                  c("div", {
                    ref: "loadingBarRef",
                    class: [`${e}-loading-bar`],
                    style: [this.cssVars, this.mergedLoadingBarStyle],
                  })
                ),
                [[f, this.loading || (!this.loading && this.entering)]]
              )
            );
          },
        }
      );
    },
  }),
  me = l({
    name: "LoadingBarProvider",
    props: Object.assign(Object.assign({}, g.props), {
      to: { type: [String, Object, Boolean], default: void 0 },
      containerClass: String,
      containerStyle: [String, Object],
      loadingBarStyle: { type: Object },
    }),
    setup(e) {
      const n = C(),
        t = h(null),
        o = {
          start() {
            var e;
            n.value
              ? null === (e = t.value) || void 0 === e || e.start()
              : b(() => {
                  var e;
                  null === (e = t.value) || void 0 === e || e.start();
                });
          },
          error() {
            var e;
            n.value
              ? null === (e = t.value) || void 0 === e || e.error()
              : b(() => {
                  var e;
                  null === (e = t.value) || void 0 === e || e.error();
                });
          },
          finish() {
            var e;
            n.value
              ? null === (e = t.value) || void 0 === e || e.finish()
              : b(() => {
                  var e;
                  null === (e = t.value) || void 0 === e || e.finish();
                });
          },
        },
        { mergedClsPrefixRef: i } = p(e);
      return (
        w(ue, o),
        w(de, { props: e, mergedClsPrefixRef: i }),
        Object.assign(o, { loadingBarRef: t })
      );
    },
    render() {
      var e, n;
      return c(
        y,
        null,
        c(
          x,
          { disabled: !1 === this.to, to: this.to || "body" },
          c(ge, {
            ref: "loadingBarRef",
            containerStyle: this.containerStyle,
            containerClass: this.containerClass,
          })
        ),
        null === (n = (e = this.$slots).default) || void 0 === n
          ? void 0
          : n.call(e)
      );
    },
  });
const be = l({
    name: "ModalEnvironment",
    props: Object.assign(Object.assign({}, z), {
      internalKey: { type: String, required: !0 },
      onInternalAfterLeave: { type: Function, required: !0 },
    }),
    setup(e) {
      const n = h(!0);
      function t() {
        n.value = !1;
      }
      return {
        show: n,
        hide: t,
        handleUpdateShow: function (e) {
          n.value = e;
        },
        handleAfterLeave: function () {
          const {
            onInternalAfterLeave: n,
            internalKey: t,
            onAfterLeave: o,
          } = e;
          n && n(t), o && o();
        },
        handleCloseClick: function () {
          const { onClose: n } = e;
          n
            ? Promise.resolve(n()).then((e) => {
                !1 !== e && t();
              })
            : t();
        },
        handleNegativeClick: function () {
          const { onNegativeClick: n } = e;
          n
            ? Promise.resolve(n()).then((e) => {
                !1 !== e && t();
              })
            : t();
        },
        handlePositiveClick: function () {
          const { onPositiveClick: n } = e;
          n
            ? Promise.resolve(n()).then((e) => {
                !1 !== e && t();
              })
            : t();
        },
        handleMaskClick: function (n) {
          const { onMaskClick: o, maskClosable: i } = e;
          o && (o(n), i && t());
        },
        handleEsc: function () {
          const { onEsc: n } = e;
          n && n();
        },
      };
    },
    render() {
      const {
        handleUpdateShow: e,
        handleAfterLeave: n,
        handleMaskClick: t,
        handleEsc: o,
        show: i,
      } = this;
      return c(
        S,
        Object.assign({}, this.$props, {
          show: i,
          onUpdateShow: e,
          onMaskClick: t,
          onEsc: o,
          onAfterLeave: n,
          internalAppear: !0,
          internalModal: !0,
        })
      );
    },
  }),
  xe = l({
    name: "ModalProvider",
    props: { to: [String, Object] },
    setup() {
      const e = h([]),
        n = {};
      const t = {
        create: function (t = {}) {
          const o = R(),
            i = j(
              Object.assign(Object.assign({}, t), {
                key: o,
                destroy: () => {
                  var e;
                  null === (e = n[`n-modal-${o}`]) || void 0 === e || e.hide();
                },
              })
            );
          return e.value.push(i), i;
        },
        destroyAll: function () {
          Object.values(n).forEach((e) => {
            null == e || e.hide();
          });
        },
      };
      return (
        w(E, t),
        w(A, { clickedRef: P(64), clickedPositionRef: O() }),
        w(L, e),
        Object.assign(Object.assign({}, t), {
          modalList: e,
          modalInstRefs: n,
          handleAfterLeave: function (n) {
            const { value: t } = e;
            t.splice(
              t.findIndex((e) => e.key === n),
              1
            );
          },
        })
      );
    },
    render() {
      var e, n;
      return c(y, null, [
        this.modalList.map((e) => {
          var n;
          return c(
            be,
            k(e, ["destroy"], {
              to: null !== (n = e.to) && void 0 !== n ? n : this.to,
              ref: (n) => {
                null === n
                  ? delete this.modalInstRefs[`n-modal-${e.key}`]
                  : (this.modalInstRefs[`n-modal-${e.key}`] = n);
              },
              internalKey: e.key,
              onInternalAfterLeave: this.handleAfterLeave,
            })
          );
        }),
        null === (n = (e = this.$slots).default) || void 0 === n
          ? void 0
          : n.call(e),
      ]);
    },
  }),
  ye = {
    closeMargin: "16px 12px",
    closeSize: "20px",
    closeIconSize: "16px",
    width: "365px",
    padding: "16px",
    titleFontSize: "16px",
    metaFontSize: "12px",
    descriptionFontSize: "12px",
  };
const Ce = $({
    name: "Notification",
    common: i,
    peers: { Scrollbar: B },
    self: function (e) {
      const {
        textColor2: n,
        successColor: t,
        infoColor: o,
        warningColor: i,
        errorColor: r,
        popoverColor: a,
        closeIconColor: s,
        closeIconColorHover: l,
        closeIconColorPressed: c,
        closeColorHover: d,
        closeColorPressed: u,
        textColor1: f,
        textColor3: p,
        borderRadius: h,
        fontWeightStrong: v,
        boxShadow2: g,
        lineHeight: m,
        fontSize: b,
      } = e;
      return Object.assign(Object.assign({}, ye), {
        borderRadius: h,
        lineHeight: m,
        fontSize: b,
        headerFontWeight: v,
        iconColor: n,
        iconColorSuccess: t,
        iconColorInfo: o,
        iconColorWarning: i,
        iconColorError: r,
        color: a,
        textColor: n,
        closeIconColor: s,
        closeIconColorHover: l,
        closeIconColorPressed: c,
        closeBorderRadius: h,
        closeColorHover: d,
        closeColorPressed: u,
        headerTextColor: f,
        descriptionTextColor: p,
        actionTextColor: n,
        boxShadow: g,
      });
    },
  }),
  we = o("n-notification-provider"),
  Se = l({
    name: "NotificationContainer",
    props: {
      scrollable: { type: Boolean, required: !0 },
      placement: { type: String, required: !0 },
    },
    setup() {
      const {
          mergedThemeRef: e,
          mergedClsPrefixRef: t,
          wipTransitionCountRef: o,
        } = n(we),
        i = h(null);
      return (
        H(() => {
          var e, n;
          o.value > 0
            ? null === (e = null == i ? void 0 : i.value) ||
              void 0 === e ||
              e.classList.add("transitioning")
            : null === (n = null == i ? void 0 : i.value) ||
              void 0 === n ||
              n.classList.remove("transitioning");
        }),
        { selfRef: i, mergedTheme: e, mergedClsPrefix: t, transitioning: o }
      );
    },
    render() {
      const {
        $slots: e,
        scrollable: n,
        mergedClsPrefix: t,
        mergedTheme: o,
        placement: i,
      } = this;
      return c(
        "div",
        {
          ref: "selfRef",
          class: [
            `${t}-notification-container`,
            n && `${t}-notification-container--scrollable`,
            `${t}-notification-container--${i}`,
          ],
        },
        n
          ? c(
              I,
              {
                theme: o.peers.Scrollbar,
                themeOverrides: o.peerOverrides.Scrollbar,
                contentStyle: { overflow: "hidden" },
              },
              e
            )
          : e
      );
    },
  }),
  ze = {
    info: () => c(V, null),
    success: () => c(q, null),
    warning: () => c(K, null),
    error: () => c(W, null),
    default: () => null,
  },
  ke = {
    closable: { type: Boolean, default: !0 },
    type: { type: String, default: "default" },
    avatar: Function,
    title: [String, Function],
    description: [String, Function],
    content: [String, Function],
    meta: [String, Function],
    action: [String, Function],
    onClose: { type: Function, required: !0 },
    keepAliveOnHover: Boolean,
    onMouseenter: Function,
    onMouseleave: Function,
  },
  Oe = F(ke),
  Pe = l({
    name: "Notification",
    props: ke,
    setup(e) {
      const { mergedClsPrefixRef: t, mergedThemeRef: o, props: i } = n(we),
        { inlineThemeDisabled: r, mergedRtlRef: a } = p(),
        s = M("Notification", a, t),
        l = v(() => {
          const { type: n } = e,
            {
              self: {
                color: t,
                textColor: i,
                closeIconColor: r,
                closeIconColorHover: a,
                closeIconColorPressed: s,
                headerTextColor: l,
                descriptionTextColor: c,
                actionTextColor: d,
                borderRadius: u,
                headerFontWeight: f,
                boxShadow: p,
                lineHeight: h,
                fontSize: v,
                closeMargin: g,
                closeSize: m,
                width: b,
                padding: x,
                closeIconSize: y,
                closeBorderRadius: C,
                closeColorHover: w,
                closeColorPressed: S,
                titleFontSize: z,
                metaFontSize: k,
                descriptionFontSize: O,
                [D("iconColor", n)]: P,
              },
              common: {
                cubicBezierEaseOut: A,
                cubicBezierEaseIn: R,
                cubicBezierEaseInOut: j,
              },
            } = o.value,
            { left: E, right: L, top: $, bottom: B } = U(x);
          return {
            "--n-color": t,
            "--n-font-size": v,
            "--n-text-color": i,
            "--n-description-text-color": c,
            "--n-action-text-color": d,
            "--n-title-text-color": l,
            "--n-title-font-weight": f,
            "--n-bezier": j,
            "--n-bezier-ease-out": A,
            "--n-bezier-ease-in": R,
            "--n-border-radius": u,
            "--n-box-shadow": p,
            "--n-close-border-radius": C,
            "--n-close-color-hover": w,
            "--n-close-color-pressed": S,
            "--n-close-icon-color": r,
            "--n-close-icon-color-hover": a,
            "--n-close-icon-color-pressed": s,
            "--n-line-height": h,
            "--n-icon-color": P,
            "--n-close-margin": g,
            "--n-close-size": m,
            "--n-close-icon-size": y,
            "--n-width": b,
            "--n-padding-left": E,
            "--n-padding-right": L,
            "--n-padding-top": $,
            "--n-padding-bottom": B,
            "--n-title-font-size": z,
            "--n-meta-font-size": k,
            "--n-description-font-size": O,
          };
        }),
        c = r
          ? m(
              "notification",
              v(() => e.type[0]),
              l,
              i
            )
          : void 0;
      return {
        mergedClsPrefix: t,
        showAvatar: v(() => e.avatar || "default" !== e.type),
        handleCloseClick() {
          e.onClose();
        },
        rtlEnabled: s,
        cssVars: r ? void 0 : l,
        themeClass: null == c ? void 0 : c.themeClass,
        onRender: null == c ? void 0 : c.onRender,
      };
    },
    render() {
      var e;
      const { mergedClsPrefix: n } = this;
      return (
        null === (e = this.onRender) || void 0 === e || e.call(this),
        c(
          "div",
          {
            class: [`${n}-notification-wrapper`, this.themeClass],
            onMouseenter: this.onMouseenter,
            onMouseleave: this.onMouseleave,
            style: this.cssVars,
          },
          c(
            "div",
            {
              class: [
                `${n}-notification`,
                this.rtlEnabled && `${n}-notification--rtl`,
                this.themeClass,
                {
                  [`${n}-notification--closable`]: this.closable,
                  [`${n}-notification--show-avatar`]: this.showAvatar,
                },
              ],
              style: this.cssVars,
            },
            this.showAvatar
              ? c(
                  "div",
                  { class: `${n}-notification__avatar` },
                  this.avatar
                    ? T(this.avatar)
                    : "default" !== this.type
                    ? c(_, { clsPrefix: n }, { default: () => ze[this.type]() })
                    : null
                )
              : null,
            this.closable
              ? c(N, {
                  clsPrefix: n,
                  class: `${n}-notification__close`,
                  onClick: this.handleCloseClick,
                })
              : null,
            c(
              "div",
              { ref: "bodyRef", class: `${n}-notification-main` },
              this.title
                ? c(
                    "div",
                    { class: `${n}-notification-main__header` },
                    T(this.title)
                  )
                : null,
              this.description
                ? c(
                    "div",
                    { class: `${n}-notification-main__description` },
                    T(this.description)
                  )
                : null,
              this.content
                ? c(
                    "pre",
                    { class: `${n}-notification-main__content` },
                    T(this.content)
                  )
                : null,
              this.meta || this.action
                ? c(
                    "div",
                    { class: `${n}-notification-main-footer` },
                    this.meta
                      ? c(
                          "div",
                          { class: `${n}-notification-main-footer__meta` },
                          T(this.meta)
                        )
                      : null,
                    this.action
                      ? c(
                          "div",
                          { class: `${n}-notification-main-footer__action` },
                          T(this.action)
                        )
                      : null
                  )
                : null
            )
          )
        )
      );
    },
  }),
  Ae = Object.assign(Object.assign({}, ke), {
    duration: Number,
    onClose: Function,
    onLeave: Function,
    onAfterEnter: Function,
    onAfterLeave: Function,
    onHide: Function,
    onAfterShow: Function,
    onAfterHide: Function,
  }),
  Re = l({
    name: "NotificationEnvironment",
    props: Object.assign(Object.assign({}, Ae), {
      internalKey: { type: String, required: !0 },
      onInternalAfterLeave: { type: Function, required: !0 },
    }),
    setup(e) {
      const { wipTransitionCountRef: t } = n(we),
        o = h(!0);
      let i = null;
      function r() {
        (o.value = !1), i && window.clearTimeout(i);
      }
      return (
        X(() => {
          e.duration && (i = window.setTimeout(r, e.duration));
        }),
        {
          show: o,
          hide: r,
          handleClose: function () {
            const { onClose: n } = e;
            n
              ? Promise.resolve(n()).then((e) => {
                  !1 !== e && r();
                })
              : r();
          },
          handleAfterLeave: function () {
            t.value--;
            const {
              onAfterLeave: n,
              onInternalAfterLeave: o,
              onAfterHide: i,
              internalKey: r,
            } = e;
            n && n(), o(r), i && i();
          },
          handleLeave: function (n) {
            const { onHide: t } = e;
            t && t(), (n.style.maxHeight = "0"), n.offsetHeight;
          },
          handleBeforeLeave: function (e) {
            t.value++,
              (e.style.maxHeight = `${e.offsetHeight}px`),
              (e.style.height = `${e.offsetHeight}px`),
              e.offsetHeight;
          },
          handleAfterEnter: function (n) {
            t.value--, (n.style.height = ""), (n.style.maxHeight = "");
            const { onAfterEnter: o, onAfterShow: i } = e;
            o && o(), i && i();
          },
          handleBeforeEnter: function (e) {
            t.value++,
              b(() => {
                (e.style.height = `${e.offsetHeight}px`),
                  (e.style.maxHeight = "0"),
                  (e.style.transition = "none"),
                  e.offsetHeight,
                  (e.style.transition = ""),
                  (e.style.maxHeight = e.style.height);
              });
          },
          handleMouseenter: function (e) {
            e.currentTarget === e.target &&
              null !== i &&
              (window.clearTimeout(i), (i = null));
          },
          handleMouseleave: function (n) {
            n.currentTarget === n.target &&
              (function () {
                const { duration: n } = e;
                n && (i = window.setTimeout(r, n));
              })();
          },
        }
      );
    },
    render() {
      return c(
        d,
        {
          name: "notification-transition",
          appear: !0,
          onBeforeEnter: this.handleBeforeEnter,
          onAfterEnter: this.handleAfterEnter,
          onBeforeLeave: this.handleBeforeLeave,
          onLeave: this.handleLeave,
          onAfterLeave: this.handleAfterLeave,
        },
        {
          default: () =>
            this.show
              ? c(
                  Pe,
                  Object.assign({}, J(this.$props, Oe), {
                    onClose: this.handleClose,
                    onMouseenter:
                      this.duration && this.keepAliveOnHover
                        ? this.handleMouseenter
                        : void 0,
                    onMouseleave:
                      this.duration && this.keepAliveOnHover
                        ? this.handleMouseleave
                        : void 0,
                  })
                )
              : null,
        }
      );
    },
  }),
  je = Y([
    r(
      "notification-container",
      "\n z-index: 4000;\n position: fixed;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n ",
      [
        Y(">", [
          r(
            "scrollbar",
            "\n width: initial;\n overflow: visible;\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",
            [
              Y(">", [
                r(
                  "scrollbar-container",
                  "\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",
                  [
                    r(
                      "scrollbar-content",
                      "\n padding-top: 12px;\n padding-bottom: 33px;\n "
                    ),
                  ]
                ),
              ]),
            ]
          ),
        ]),
        s("top, top-right, top-left", "\n top: 12px;\n ", [
          Y("&.transitioning >", [
            r("scrollbar", [
              Y(">", [
                r("scrollbar-container", "\n min-height: 100vh !important;\n "),
              ]),
            ]),
          ]),
        ]),
        s("bottom, bottom-right, bottom-left", "\n bottom: 12px;\n ", [
          Y(">", [
            r("scrollbar", [
              Y(">", [
                r("scrollbar-container", [
                  r("scrollbar-content", "\n padding-bottom: 12px;\n "),
                ]),
              ]),
            ]),
          ]),
          r(
            "notification-wrapper",
            "\n display: flex;\n align-items: flex-end;\n margin-bottom: 0;\n margin-top: 12px;\n "
          ),
        ]),
        s("top, bottom", "\n left: 50%;\n transform: translateX(-50%);\n ", [
          r("notification-wrapper", [
            Y(
              "&.notification-transition-enter-from, &.notification-transition-leave-to",
              "\n transform: scale(0.85);\n "
            ),
            Y(
              "&.notification-transition-leave-from, &.notification-transition-enter-to",
              "\n transform: scale(1);\n "
            ),
          ]),
        ]),
        s("top", [
          r("notification-wrapper", "\n transform-origin: top center;\n "),
        ]),
        s("bottom", [
          r("notification-wrapper", "\n transform-origin: bottom center;\n "),
        ]),
        s("top-right, bottom-right", [
          r("notification", "\n margin-left: 28px;\n margin-right: 16px;\n "),
        ]),
        s("top-left, bottom-left", [
          r("notification", "\n margin-left: 16px;\n margin-right: 28px;\n "),
        ]),
        s("top-right", "\n right: 0;\n ", [Ee("top-right")]),
        s("top-left", "\n left: 0;\n ", [Ee("top-left")]),
        s("bottom-right", "\n right: 0;\n ", [Ee("bottom-right")]),
        s("bottom-left", "\n left: 0;\n ", [Ee("bottom-left")]),
        s("scrollable", [
          s("top-right", "\n top: 0;\n "),
          s("top-left", "\n top: 0;\n "),
          s("bottom-right", "\n bottom: 0;\n "),
          s("bottom-left", "\n bottom: 0;\n "),
        ]),
        r("notification-wrapper", "\n margin-bottom: 12px;\n ", [
          Y(
            "&.notification-transition-enter-from, &.notification-transition-leave-to",
            "\n opacity: 0;\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n "
          ),
          Y(
            "&.notification-transition-leave-from, &.notification-transition-enter-to",
            "\n opacity: 1;\n "
          ),
          Y(
            "&.notification-transition-leave-active",
            "\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-in),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n "
          ),
          Y(
            "&.notification-transition-enter-active",
            "\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-out),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n "
          ),
        ]),
        r(
          "notification",
          "\n background-color: var(--n-color);\n color: var(--n-text-color);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n font-family: inherit;\n font-size: var(--n-font-size);\n font-weight: 400;\n position: relative;\n display: flex;\n overflow: hidden;\n flex-shrink: 0;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n width: var(--n-width);\n max-width: calc(100vw - 16px - 16px);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n box-sizing: border-box;\n opacity: 1;\n ",
          [
            G("avatar", [
              r("icon", "\n color: var(--n-icon-color);\n "),
              r("base-icon", "\n color: var(--n-icon-color);\n "),
            ]),
            s("show-avatar", [
              r(
                "notification-main",
                "\n margin-left: 40px;\n width: calc(100% - 40px); \n "
              ),
            ]),
            s("closable", [
              r("notification-main", [
                Y("> *:first-child", "\n padding-right: 20px;\n "),
              ]),
              G(
                "close",
                "\n position: absolute;\n top: 0;\n right: 0;\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n "
              ),
            ]),
            G(
              "avatar",
              "\n position: absolute;\n top: var(--n-padding-top);\n left: var(--n-padding-left);\n width: 28px;\n height: 28px;\n font-size: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n ",
              [r("icon", "transition: color .3s var(--n-bezier);")]
            ),
            r(
              "notification-main",
              "\n padding-top: var(--n-padding-top);\n padding-bottom: var(--n-padding-bottom);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n width: calc(100% - 8px);\n ",
              [
                r(
                  "notification-main-footer",
                  "\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 12px;\n ",
                  [
                    G(
                      "meta",
                      "\n font-size: var(--n-meta-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "
                    ),
                    G(
                      "action",
                      "\n cursor: pointer;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-action-text-color);\n "
                    ),
                  ]
                ),
                G(
                  "header",
                  "\n font-weight: var(--n-title-font-weight);\n font-size: var(--n-title-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-title-text-color);\n "
                ),
                G(
                  "description",
                  "\n margin-top: 8px;\n font-size: var(--n-description-font-size);\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "
                ),
                G(
                  "content",
                  "\n line-height: var(--n-line-height);\n margin: 12px 0 0 0;\n font-family: inherit;\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-text-color);\n ",
                  [Y("&:first-child", "margin: 0;")]
                ),
              ]
            ),
          ]
        ),
      ]
    ),
  ]);
function Ee(e) {
  const n = e.split("-")[1];
  return r("notification-wrapper", [
    Y(
      "&.notification-transition-enter-from, &.notification-transition-leave-to",
      `\n transform: translate(${
        "left" === n ? "calc(-100%)" : "calc(100%)"
      }, 0);\n `
    ),
    Y(
      "&.notification-transition-leave-from, &.notification-transition-enter-to",
      "\n transform: translate(0, 0);\n "
    ),
  ]);
}
const Le = o("n-notification-api"),
  $e = l({
    name: "NotificationProvider",
    props: Object.assign(Object.assign({}, g.props), {
      containerClass: String,
      containerStyle: [String, Object],
      to: [String, Object],
      scrollable: { type: Boolean, default: !0 },
      max: Number,
      placement: { type: String, default: "top-right" },
      keepAliveOnHover: Boolean,
    }),
    setup(e) {
      const { mergedClsPrefixRef: n } = p(e),
        t = h([]),
        o = {},
        i = new Set();
      function r(n) {
        const r = R(),
          a = () => {
            i.add(r), o[r] && o[r].hide();
          },
          s = j(
            Object.assign(Object.assign({}, n), {
              key: r,
              destroy: a,
              hide: a,
              deactivate: a,
            })
          ),
          { max: l } = e;
        if (l && t.value.length - i.size >= l) {
          let e = !1,
            n = 0;
          for (const r of t.value) {
            if (!i.has(r.key)) {
              o[r.key] && (r.destroy(), (e = !0));
              break;
            }
            n++;
          }
          e || t.value.splice(n, 1);
        }
        return t.value.push(s), s;
      }
      const a = ["info", "success", "warning", "error"].map(
        (e) => (n) => r(Object.assign(Object.assign({}, n), { type: e }))
      );
      const s = g("Notification", "-notification", je, Ce, e, n),
        l = {
          create: r,
          info: a[0],
          success: a[1],
          warning: a[2],
          error: a[3],
          open: function (e) {
            return r(e);
          },
          destroyAll: function () {
            Object.values(t.value).forEach((e) => {
              e.hide();
            });
          },
        },
        c = h(0);
      return (
        w(Le, l),
        w(we, {
          props: e,
          mergedClsPrefixRef: n,
          mergedThemeRef: s,
          wipTransitionCountRef: c,
        }),
        Object.assign(
          {
            mergedClsPrefix: n,
            notificationList: t,
            notificationRefs: o,
            handleAfterLeave: function (e) {
              i.delete(e),
                t.value.splice(
                  t.value.findIndex((n) => n.key === e),
                  1
                );
            },
          },
          l
        )
      );
    },
    render() {
      var e, n, t;
      const { placement: o } = this;
      return c(
        y,
        null,
        null === (n = (e = this.$slots).default) || void 0 === n
          ? void 0
          : n.call(e),
        this.notificationList.length
          ? c(
              x,
              { to: null !== (t = this.to) && void 0 !== t ? t : "body" },
              c(
                Se,
                {
                  class: this.containerClass,
                  style: this.containerStyle,
                  scrollable: this.scrollable && "top" !== o && "bottom" !== o,
                  placement: o,
                },
                {
                  default: () =>
                    this.notificationList.map((e) =>
                      c(
                        Re,
                        Object.assign(
                          {
                            ref: (n) => {
                              const t = e.key;
                              null === n
                                ? delete this.notificationRefs[t]
                                : (this.notificationRefs[t] = n);
                            },
                          },
                          k(e, ["destroy", "hide", "deactivate"]),
                          {
                            internalKey: e.key,
                            onInternalAfterLeave: this.handleAfterLeave,
                            keepAliveOnHover:
                              void 0 === e.keepAliveOnHover
                                ? this.keepAliveOnHover
                                : e.keepAliveOnHover,
                          }
                        )
                      )
                    ),
                }
              )
            )
          : null
      );
    },
  });
const Be = l({
    name: "InjectionExtractor",
    props: { onSetup: Function },
    setup(e, { slots: n }) {
      var t;
      return (
        null === (t = e.onSetup) || void 0 === t || t.call(e),
        () => {
          var e;
          return null === (e = n.default) || void 0 === e ? void 0 : e.call(n);
        }
      );
    },
  }),
  Ie = {
    message: le,
    notification: function () {
      const t = n(Le, null);
      return (
        null === t &&
          e("use-notification", "No outer `n-notification-provider` found."),
        t
      );
    },
    loadingBar: function () {
      const t = n(ue, null);
      return (
        null === t &&
          e("use-loading-bar", "No outer <n-loading-bar-provider /> founded."),
        t
      );
    },
    dialog: ce,
    modal: ne,
  };
function He(
  e,
  {
    configProviderProps: n,
    messageProviderProps: t,
    dialogProviderProps: o,
    notificationProviderProps: i,
    loadingBarProviderProps: r,
    modalProviderProps: a,
  } = {}
) {
  const s = [];
  e.forEach((e) => {
    switch (e) {
      case "message":
        s.push({ type: e, Provider: re, props: t });
        break;
      case "notification":
        s.push({ type: e, Provider: $e, props: i });
        break;
      case "dialog":
        s.push({ type: e, Provider: ie, props: o });
        break;
      case "loadingBar":
        s.push({ type: e, Provider: me, props: r });
        break;
      case "modal":
        s.push({ type: e, Provider: xe, props: a });
    }
  });
  const l = (function ({ providersAndProps: e, configProviderProps: n }) {
    let t = Q(function () {
      return c(ee, Z(n), {
        default: () =>
          e.map(({ type: e, Provider: n, props: t }) =>
            c(n, Z(t), {
              default: () => c(Be, { onSetup: () => (o[e] = Ie[e]()) }),
            })
          ),
      });
    });
    const o = { app: t };
    let i;
    return (
      te &&
        ((i = document.createElement("div")),
        document.body.appendChild(i),
        t.mount(i)),
      Object.assign(
        {
          unmount: () => {
            var e;
            null !== t && null !== i
              ? (t.unmount(),
                null === (e = i.parentNode) || void 0 === e || e.removeChild(i),
                (i = null),
                (t = null))
              : oe(
                  "discrete",
                  "unmount call no need because discrete app has been unmounted"
                );
          },
        },
        o
      )
    );
  })({ providersAndProps: s, configProviderProps: n });
  return l;
}
function Fe(e) {
  for (var n = 1; n < arguments.length; n++) {
    var t = arguments[n];
    for (var o in t) e[o] = t[o];
  }
  return e;
}
var Te = (function e(n, t) {
  function o(e, o, i) {
    if ("undefined" != typeof document) {
      "number" == typeof (i = Fe({}, t, i)).expires &&
        (i.expires = new Date(Date.now() + 864e5 * i.expires)),
        i.expires && (i.expires = i.expires.toUTCString()),
        (e = encodeURIComponent(e)
          .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
          .replace(/[()]/g, escape));
      var r = "";
      for (var a in i)
        i[a] &&
          ((r += "; " + a), !0 !== i[a] && (r += "=" + i[a].split(";")[0]));
      return (document.cookie = e + "=" + n.write(o, e) + r);
    }
  }
  return Object.create(
    {
      set: o,
      get: function (e) {
        if ("undefined" != typeof document && (!arguments.length || e)) {
          for (
            var t = document.cookie ? document.cookie.split("; ") : [],
              o = {},
              i = 0;
            i < t.length;
            i++
          ) {
            var r = t[i].split("="),
              a = r.slice(1).join("=");
            try {
              var s = decodeURIComponent(r[0]);
              if (((o[s] = n.read(a, s)), e === s)) break;
            } catch (l) {}
          }
          return e ? o[e] : o;
        }
      },
      remove: function (e, n) {
        o(e, "", Fe({}, n, { expires: -1 }));
      },
      withAttributes: function (n) {
        return e(this.converter, Fe({}, this.attributes, n));
      },
      withConverter: function (n) {
        return e(Fe({}, this.converter, n), this.attributes);
      },
    },
    {
      attributes: { value: Object.freeze(t) },
      converter: { value: Object.freeze(n) },
    }
  );
})(
  {
    read: function (e) {
      return (
        '"' === e[0] && (e = e.slice(1, -1)),
        e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
      );
    },
    write: function (e) {
      return encodeURIComponent(e).replace(
        /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
        decodeURIComponent
      );
    },
  },
  { path: "/" }
);
const _e = "XY_USER_TOKEN",
  Ne = "XY_LOGIN_TOKEN",
  Me = "XY_GAME_ROLE",
  De = "XY_UPDATE_VERSION",
  Ue = "XY_DAILY_TASK_SETTING",
  We = (e) => Te.set(_e, e, { expires: 1 }),
  Ke = () => Te.remove(_e),
  qe = (e) => Te.set(Ne, e, { expires: 180 }),
  Ve = () => Te.remove(Ne),
  Je = () => Te.get(Ne),
  Xe = (e) => Te.set(Me, JSON.stringify(e), { expires: 180 }),
  Ye = () => Te.remove(Me),
  Ge = () => {
    const e = Te.get(Me);
    return e ? JSON.parse(e) : void 0;
  },
  Qe = (e) => Te.set(De, e.toString(), { expires: 365 }),
  Ze = () => (Te.get(De) ? parseInt(Te.get(De)) : void 0),
  en = (e, n) => Te.set(Ue + "_" + e, JSON.stringify(n), { expires: 180 }),
  nn = (e) => {
    const n = Te.get(Ue + "_" + e);
    return n
      ? JSON.parse(n)
      : {
          arenaFormation: 1,
          bossFormation: 1,
          bossTimes: 2,
          claimBottle: !0,
          payRecruit: !0,
          openBox: !0,
          areanEnable: !0,
          claimHangUp: !0,
          claimEmail: !0,
        };
  },
  tn = (e, n = {}) => {
    const t = h(!1),
      o = h(),
      i = h(null),
      r = h(),
      { message: a } = He(["message"]),
      s = ae();
    return {
      loading: Z(t),
      data: o,
      error: i,
      pagination: r,
      execute: async function (l = {}) {
        var c;
        try {
          (t.value = !0), (i.value = null);
          const s = {};
          let d;
          (d = e.toString().startsWith("/api/admin") ? Te.get(_e) : Je()),
            d && (s.Authorization = "Bearer " + d);
          const u = await $fetch(e, {
            ...n,
            headers: { ...s, ...n.headers, "content-type": "application/json" },
            ...l,
          });
          return (
            u.success
              ? ((o.value = u.data),
                (null == (c = null == u ? void 0 : u.data)
                  ? void 0
                  : c.pagination) && (r.value = u.data.pagination),
                u.message && "ok" !== u.message && a.success(u.message))
              : a.error(u.message || "操作失败"),
            u
          );
        } catch (d) {
          throw (
            ((async (e) => {
              var n;
              if (
                ((i.value = e), null == (n = e.response) ? void 0 : n._data)
              ) {
                const n = await s.decryptData(e.response._data),
                  t = JSON.parse(n);
                a.error((null == t ? void 0 : t.message) || "请求失败");
              } else e.message ? a.error(e.message) : a.error("发生未知错误");
              401 === e.statusCode && se("/login");
            })(d),
            d)
          );
        } finally {
          t.value = !1;
        }
      },
    };
  };
export {
  nn as a,
  Je as b,
  He as c,
  ce as d,
  Xe as e,
  Ve as f,
  Ge as g,
  qe as h,
  Ke as i,
  We as j,
  Ze as k,
  Qe as l,
  Ye as r,
  en as s,
  tn as u,
};
